from ultralytics import YOLO

# 加载预训练模型
model = YOLO('yolov8n.pt')

# 开始训练
results = model.train(
    data='rail_dataset/rail.yaml',
    epochs=10,
    imgsz=640,
    batch=2,
    device='cpu',
    project='runs/rail',
    name='yolov8n_damage_v1'
)
